<%-- 
    Document   : formEmpIntervenant
    Created on : 26 févr. 2013, 12:17:01
    Author     : ali
--%>


<%@page import="java.util.Calendar"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.Date"%>
<%@page import="java.text.DateFormat"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
                
        <title>Ajouter une formation</title>
            <link rel="stylesheet" href="Accueil.css" />
            <link rel="SHORTCUT ICON" href="./edt.jpg" />
            <script language="JavaScript">
            
            
            function miseAjour(cpt){
                 var select = document.createElement('select');
                select.setAttribute("name", "niveau");
                select.setAttribute("id", "niveau");
                var option;
                //alert(nbGp);
                var i=1;
                
                while (i<= cpt)
                {
                    option = document.createElement('option');
                    option.setAttribute("value", i);
                    option.appendChild(document.createTextNode(i));
                    select.appendChild(option);
                    i++;
                }
                //document.getElementById('grp').removeChild("groupe");
                document.getElementById('niv').replaceChild(select, document.getElementById('niveau'));
            }
            
            
        </script>
            
    </head>


    <body>    
         
    <section>
               
    <!--<form method='POST' action='PromoNivGradForm.do'> -->
   <%
    String form ="";
    
        form += "<form method='POST' action='AjoutFormationAction.do' target='section'>";
        form += "<div class='commentaire'>";
        form += "<fieldset>";
        
        
        form +="<legend>    Ajouter une formation  :   </legend>";
        
        form +="<input type='hidden' name='key' value='"+session.getAttribute("key")+"' />";
        form +="Grade : <select name='grade'>";
        form +="    <option value='Licence' onclick='miseAjour(3)'>Licence</option>";
        form +="    <option value='Master' onclick='miseAjour(2)'>Master</option>";
        form +="</select><br/><br/>";
       
        form +="<div id='niv'>";
        form +="Niveau : <select name='niveau' id='niveau'>";
        form +="    <option value='1'>1</option>";
        form +="    <option value='2'>2</option>";
        form +="    <option value='3'>3</option>";
        form +="</select><br/><br/>";
        form +="</div>";
        
        
        form +="Filière : <input type='text' name='filiere' value='Info'/><br/><br/>";
        
        form +="Parcours : <input type='text' name='parcours' value='MIAGE'/><br/><br/>";
        
        form +="Type : <select name='type'>";
        form +="    <option value='Apprentissage'>Apprentissage</option>";
        form +="    <option value='Classique'>Classique</option>";
        form += "</select><br/><br/>";
                
        form +="Nombre de semestre (periode) : <select name='periode'>";
        form +="    <option value='1'>1</option>";
        form +="    <option value='2'>2</option>";
        form +="    <option value='3'>3</option>";
        form +="    <option value='4'>4</option>";
        form +="    <option value='5'>5</option>";
        form +="    <option value='6'>6</option>";
        form +="    <option value='7'>7</option>";
        form +="    <option value='8'>8</option>";
        form +="    <option value='9'>9</option>";
        form +="    <option value='10'>10</option>";
        form += "</select><br/><br/>";
        
        DateFormat dateFormat = new SimpleDateFormat("yyyy");
        Calendar cal = Calendar.getInstance(); 
        cal.setTime(new Date());
        Integer a =Integer.parseInt(dateFormat.format(cal.getTime()))+4;
        form +="Année d'expiration du contrat : <input type='text' name='anneeex' value='"+a+"'/><br/><br/>";
        
        form += "<input type='submit' value='valider'/><br/>";
        out.println(form);
            
    %>
    
   
    
    
    <html:errors/> 
    
    </fieldset>
    
        
    </div>

    </form>
         
    </section>
    </body>
</html>
